package com.example.question.array;

public class Code10_125 {


    public boolean isPalindrome(String s) {
        String lowerCase = s.toLowerCase();
        char[] chars = lowerCase.toCharArray();
        int u = 0;
        char[] newChars = new char[chars.length];
        for (char aChar : chars) {
            if (aChar >= '0' && aChar <= '9' || aChar >= 'a' && aChar <= 'z') {
                newChars[u++] = aChar;
            }
        }
        int i = 0;
        int j = u - 1;
        while (i < j) {
            if (newChars[i] != newChars[j]) {
                return false;
            }
            i++;
            j--;
        }
        return true;
    }
}
